package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note.txt",true);
        Scanner scan = new Scanner(System.in);
        System.out.println("开始输入内容，单独输入exit则退出！！！");
        String str;
        while(true){
             str= scan.nextLine();
             if("eXit".equalsIgnoreCase(str)){
                 System.out.println("退出写入");
                 break;
             }
             str +="\t";
             fos.write(str.getBytes(StandardCharsets.UTF_8));

        }
        System.out.println("写入完毕！！！");
        fos.close();
    }
}
